<template>
    <el-card class="box-card">
        <el-table :data="tableData" border stripe height="250" style="width: 100%" >
            <el-table-column prop="id" label="编号" sortable width="100" />
            <el-table-column prop="nickName" label="用户" width="100" />
            <el-table-column prop="oprTime" label="使用时间" sortable width="160" />
            <el-table-column prop="tokens" label="消耗Token" sortable width="150" />
            <el-table-column prop="pay" label="支付积分" width="100" />
        </el-table>
    </el-card>
</template>

<script>
import axios from "../plugins/axios.js";
export default {
    data(){
        return {
            tableData: []
        }
    },
    mounted(){
        var curUser=JSON.parse(sessionStorage.getItem("user"));
        axios.get(
            "http://localhost:9000/record/list?userId="+curUser.id
        ).then((resp)=>{
            if(resp.data.code==2000)
                this.tableData=resp.data.data;
            else
                alert(resp.data.msg);
        })
    }
}
</script>


<style scoped>
.box-card {
    background-color: rgb(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 10px;
    border: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 700px;
    margin: 150px auto; 
    transition: transform 0.3s ease-in-out;
}
</style>